package com.dongdongshop.mq;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Component
@RequestMapping("mq")
public class Producer {

    //rocketMQTemplate
    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @ResponseBody
    @RequestMapping("Producer")
    public String Producer(String pm){
        rocketMQTemplate.convertAndSend("ggw",pm);
        return "ok";
    }
}
